import 'package:flutter/material.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/publicBussine/bussine_font.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_button.dart';

class HireRentRentButton extends StatelessWidget {
  final double price;
  final Function()? rentAction;
  const HireRentRentButton({
    super.key,
    this.price = 0.00,
    this.rentAction,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      padding: EdgeInsets.only(left: 16, right: 16, top: 12, bottom: 30),
      child: Row(
        children: [
          Text.rich(TextSpan(children: [
            TextSpan(
                text: "总计  ",
                style: TextStyle(
                  fontSize: MGFont.textFont1,
                  color: MGColors.text1Color,
                  fontWeight: FontWeight.bold,
                )),
            TextSpan(
                text: "¥ ",
                style: TextStyle(
                  fontSize: MGFont.textFont1,
                  color: MGColors.redColor,
                  fontWeight: FontWeight.bold,
                )),
            TextSpan(
                text: price.toStringAsFixed(2),
                style: TextStyle(
                  fontSize: MGFont.titleFont4,
                  color: MGColors.redColor,
                  fontWeight: FontWeight.bold,
                )),
          ])),
          Container(
            width: 180,
            child: MGButton(title: "租用", buttonAction: rentAction),
          )
        ],
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
      ),
    );
  }
}
